package com.wanwu.channel.biz.context;


import com.wanwu.channel.dao.entity.ChannelApplyClearanceEntity;
import com.wanwu.channel.dao.entity.ChannelMerchantInfoEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.lang.reflect.Field;

/**
 * @author JiWen
 * @time 2020/3/25 21:44
 */
@Getter
@Setter
public class DeclareContext {
    private ChannelMerchantInfoEntity channelMerchantInfoEntity;
    private ChannelApplyClearanceEntity applyClearanceEntity;
    private Boolean needDeclare;
    private String appId;
    private String mchId;
    private String payPhone;
    private String postscript;
    //是否阿里的第二次报关
    private Boolean aliTwiceDeclare = false;
    //报关的时候是否有修改信息（微信专用）
    private Boolean reDeclareChange = false;

    public DeclareContext(ChannelApplyClearanceEntity applyClearanceEntity) {
        this.applyClearanceEntity = applyClearanceEntity;
    }

    public DeclareContext() {
    }

    @Override
    public String toString() {
        return (new ReflectionToStringBuilder(this, ToStringStyle.JSON_STYLE) {
            @Override
            protected boolean accept(Field f) {
                return super.accept(f) && !f.getName().equals("payPhone");
            }
        }).toString();
    }
}
